from django.db import models

from utils.BaseModel import BaseModel

# Create your models here.

class Nav(BaseModel):
    name=models.CharField(max_length=10,verbose_name='导航栏名称')
    position=models.IntegerField(verbose_name='导航栏位置',default=0)
    link=models.CharField(max_length=100,verbose_name='导航栏拦截',default='')

    class Meta:
        db_table='nav'
    def __str__(self):
        return self.name


class Banner(BaseModel):
    title=models.CharField(max_length=12)
    link=models.CharField(max_length=150)
    image = models.ImageField(upload_to="upload/banner", verbose_name="图片地址")
    class Meta:
        db_table='banner'
    def __str__(self):
        return self.title
